import request from '@/utils/request'
import mock from '@/utils/mock'
// var Mock = require('mockjs')

//查询方法

// const baseUrl=''
// const urlCommon = {
//   queryApi: {
//       url: baseUrl + '/exam/gm-money-rule/findByPage',
//       method: 'post'
//   }
// }
// export default urlCommon
// export function queryListApi(data){
//   return  Mock.mock({
//     'resultSet': {
//       'clients|10': [{
//         'clientId': '@increment(100)',
//         'clientName': '@cword(6,20)',
//         'englishName': '@clast',
//         'activitiesNum': '@increment(1)',
//         'opportunitiesNum': '@increment(1)',
//         'contactNum': '@increment(1)'

//       }],
//       'pageNext': true
//     },
//     'retCode': '0000000',
//     'retMsg': 'success'
//   })
// }
// export function queryApi(url, params) {
//   return request(url, {
//     body: {
//       data: params
//     }
//   });
// }
// 
export function api_formData(url, data) {
  const formData = new FormData()
  for (const key in data) {
    formData.append(key, data[key])
  }
  return request(url,{
    apiType: 'form',
    body:{
      data: formData,
      method: 'POST',
    },
  })
}
export function exportListPage( params) {
  var dataParam = params?params:{"reqBody":{}};
  return request('/bs-md-export/listByPage', {
    body: {
      data: dataParam
    }
  });
}
export function exportColumnList( params) {
  var dataParam = params?params:{"reqBody":{}};
  return request('/bs-md-export-column/list', {
    body: {
      data: dataParam
    }
  });
}
export async function queryApi(url, params) {
  return request(url, {
    body: {
      data: params
    }
  });
}

//比赛项目查询
// export function queryApi(data) {
//   return request({
//     url: '/bs-md-export/listByPage',
//     method: 'POST',
//     data: data
//   })
// }
export function queryListApi(data) {
  return request({
    // clientList
    url: mock.clientList,
    method: 'post',
    data: data
  })
}
//比赛项目查询
export function query(data) {
  return request({
    url: '/exam/gm-money-rule/findByPage',
    method: 'post',
    data: data
  })
}
//上传
export function fileUpload(data) {
  return request({
    url: '/exam/gm-dan-grading/uploadDanGradingImage',
    method: 'filepost',
    data: data
  })
}

export function fileUploadvideo(data) {
  return request({
    url: '/exam/file/uploadFile',
    method: 'filepost',
    data:data
  })
}
export function taskTodoList(data) {
  return request("/flow/listByPage", {
    body: {
      data: data
    }
  });
}
export function myLaunchList(data) {
  let req={"reqBody":{"pageSize":"30","pageNum":1}}
  return request("/dh-flow/listByPage", {
    body: {
      data: req
    }
  });
}
export function detectionTime(data) {
  return request("/dh-flow/findDetail", {
    body: {
      data: data
    }
  });
}
export function fileUploadJt(data) {
  return request(
    '/qtfile/simple/upload',
    {
      body: {
        data: data,
        method: 'filepost',
      }
    }
  )
}


